package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Mobile   string `gorm:"type:char(11)"`
	Password string `gorm:"type:varchar(32)"`
	Nickname string `gorm:"type:varchar(50)"`
	Status   int    `gorm:"type:int;default:1;comment:用户状态: 1 正常 0 冻结"`
}

func (u *User) GetUserById() error {
	return DB.Model(u).Where("status = 1").First(&u).Error
}
